{% extends '__base__.html' %}
{% block page_title %}
{{ g.sitename }}
{% endblock %}
{% block content %}
hello
<h1>
    hello, world!!
</h1>
<button class="btn btn-default">sure</button>
<input type="text" class="select2 col-lg-1">

<script type="text/javascript">
$(".select2").select2({
  tags: true,
  tokenSeparators: [",", " "],
  createSearchChoice: function(term, data) {
    alert(term);
    if ($(data).filter(function() {
      console.log(data);
      console.log(tem);
      return this.text.localeCompare(term) === 0;
    }).length === 0) {
        console.log('no data')
        console.log(term)
      return {
        id: term,
        text: term
      };
    }
  },
  multiple: true,
  ajax: {
    url: '/static/select2.jquery.json',
    dataType: "json",
    data: function(term, page) {
      return {
        q: term
      };
    },
    results: function(data, page) {
      return {
        results: data
      };
    }
  }});

</script>
{% endblock %}
